package com.pureut.job.task;

import com.pureut.equipment.api.FeignEquipmentService;
import com.pureut.system.api.StorageFegin;
import org.springframework.stereotype.Component;
import com.pureut.common.core.utils.StringUtils;

import javax.annotation.Resource;

/**
 * 定时任务调度测试
 *
 * @author ruoyi
 */
@Component("ryTask")
public class RyTask {

    /**
     * 保养计划service
     */
    @Resource
    FeignEquipmentService feignEquipmentService;

    /**
     * 仓库service
     */
    @Resource
    StorageFegin storageFegin;

    public void ryMultipleParams(String s, Boolean b, Long l, Double d, Integer i) {
        System.out.println(StringUtils.format("执行多参方法： 字符串类型{}，布尔类型{}，长整型{}，浮点型{}，整形{}", s, b, l, d, i));
    }

    public void ryParams(String params) {
        System.out.println("执行有参方法：" + params);
    }

    public void ryNoParams() {
        //保养计划修改状态feign
        feignEquipmentService.updateMaintenanceStatusByTime();
        //点检计划修改状态feign
        feignEquipmentService.updateInspectionStatusByTime();
        //巡检计划修改状态feign
        feignEquipmentService.updatePatrolStatusByTime();
        //触发生成工单
        feignEquipmentService.generationWorkOrder();
    }

    public void ryMessage() throws Exception {
        storageFegin.maxStock();
        storageFegin.recheck();
        storageFegin.expirationDate();
    }
}
